package com.class01._this;

/**
 * @ClassDescription:
 * @JdkVersion: 17
 * @Author: yxy
 * @Created: 2024/4/2 10:33
 */
public class UserTest {
    public static void main(String[] args) {
        User user = new User("李四");
        System.out.println(user.name);
    }
}

class User {
    String name ="1000";
    int age;

    String address;

    public User() {

        for (int i = 0; i < 10; i++) {
            System.out.println("无参构造方法");
        }

//      模拟对象创建时，需要初始化50行代码
    }

    public User(String name) {
        this();
        Person person = new Person();
        this.name = name;


    }
    public User(int age){

    }

    public User(String name, int age) {
//        this("yxy", 18);
        this(name,68,"北京");
        this.age = age;
        this.name = name;

    }

    public User(String name, int age, String address) {
//        this("yxy", 18);


        this.age = age;
        this.name = name;

    }
}
